package com.neuedu.controller.backend;

import com.neuedu.common.JSONData;
import com.neuedu.pojo.ProductSKU;
import com.neuedu.service.ProductSKUService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;

@Api(value = "/mananger/productsku",description = "后台商品SKU管理相关接口")
@Controller
@RequestMapping("/manager/productsku")
public class ProductSKUController {
    @Autowired
    private ProductSKUService productSKUService;

    @ApiOperation(value = "添加商品SKU信息",notes = "描述信息",httpMethod = "POST")
    @RequestMapping(value = "addProductSKU",method = RequestMethod.POST)
    @ResponseBody
    public JSONData<String> addProductSKU(HttpSession session, ProductSKU productSKU){
        JSONData<String> data = productSKUService.addProductSKU(productSKU);
        return data;
    }
    @ApiOperation(value = "查询商品SKU信息",notes = "描述信息",httpMethod = "POST")
    @RequestMapping(value = "queryProductSKUBySpecs",method = RequestMethod.POST)
    @ResponseBody
    public JSONData<List<ProductSKU>> queryProductSKUBySpecs(HttpSession session,ProductSKU productSKU){
        JSONData<List<ProductSKU>> data = productSKUService.queryProductSKUBySpecs(productSKU);
        return data;
    }
    //-商品SKU 删除

    //-商品SKU 修改
}
